//
//  UIColor-Extension.swift
//  DYZB
//
//  Created by HOu on 2021/11/19.
//

import UIKit

extension UIColor{
    
    convenience init(r:CGFloat,g:CGFloat,b:CGFloat){
        self.init(red:r / 255.0,green:g / 255.0,blue:b / 255.0,alpha:1.0)
    }
    
    // MARK: - 随机颜色
    class var randomColor:UIColor{
        get{
            let red = CGFloat(arc4random()%256)/255.0
            let green = CGFloat(arc4random()%256)/255.0
            let blue = CGFloat(arc4random()%256)/255.0
            return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
        }
    }
    
}


